package edu.dayu.iterator;

import java.util.Iterator;

public class Test {
    public static void main(String[] args) {
        MyIterator<String> stringMyIterator = new MyIterator<>();
        stringMyIterator.add("1");
        stringMyIterator.add("2");
        stringMyIterator.add("3");
        stringMyIterator.add("4");
        Iterator iterator = stringMyIterator.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
            //1
            //2
            //3
            //4
        }
    }
}
